<%@ page import="com.zafu.dao.AddressBean" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.zafu.entity.AddressInfo" %>
<%@ page import="com.zafu.entity.GoodsInfo" %>
<%@ page import="java.util.Iterator" %><%--
  Created by IntelliJ IDEA.
  User: 86189
  Date: 2024/12/20
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    AddressBean bean = new AddressBean();
    ArrayList<AddressInfo> data = bean.GetAll();
    StringBuilder  builder = new StringBuilder();
    out.println("<User>");
    Iterator<AddressInfo> iter = data.iterator();
    while (iter.hasNext()) {
        AddressInfo info = iter.next();
        builder.append(info.toString()).append("\n");
        out.println("<Address>");
        out.println("<address>" + info.getAddress() + "</address>");
        out.println("<username>" + info.getUsername() + "</username>");
        out.println("<user_phone>" + info.getUser_phone() + "</user_phone>");
        out.println("<chosen>" + info.getChosen() + "</chosen>");
        out.println("<id>" + info.getId() + "</id>");
        out.println("</Address>");
    }
    out.println("</User>");
    System.out.printf(builder.toString());
%>
